﻿using System.Collections.Generic;
using cludg.Services.Security.Permissions;
using cludg.Domain.Users;

namespace cludg.Web.Permissions
{
	public class OffersPermisionProviders : IPermissionProvider
	{
		protected readonly List<Permission> Permissions = new List<Permission>();

		public OffersPermisionProviders()
			: base()
		{
			Permissions.Add(new RoleBasedPermission { Caption = "Предложить", Name = "AddOffer", Roles = Roles.All });
			Permissions.Add(new RoleBasedPermission { Caption = "Смотреть предложения", Name = "ViewOffers", Roles = Roles.AuthorAndAdmin });
			Permissions.Add(new RoleBasedPermission { Caption = "Принять историю", Name = "ApproveOffer", Roles = Roles.AuthorAndAdmin });
			Permissions.Add(new RoleBasedPermission { Caption = "Отклонить историю", Name = "DeclineOffer", Roles = Roles.AuthorAndAdmin });
		}

		public IEnumerable<Permission> GetPermissions()
		{
			return Permissions;
		}
	}
}